home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
The CDPD Public Domain Collection for CDTV 4
/
CDPD_IV.bin
/
e
/
mailinglists
/
amigae.0294feb.archive
/
000047_donews!crash!h…m.ac.uk!dmh1002_Sat, 12 Feb 94 01:46:32 PST.msg
< prev
next >
Wrap
Internet Message Format
|
1994-05-26
|
3KB
Received: by bkhouse.cts.com (V1.17-beta/Amiga)
id <1t9h@bkhouse.cts.com>; Sat, 12 Feb 94 01:46:32 PST
Received: from crash by donews.cts.com with uucp
(Smail3.1.28.1 #18) id m0pVGiF-0001THC; Sat, 12 Feb 94 04:32 EST
Received: from ppsw2.cam.ac.uk by crash.cts.com with smtp
(Smail3.1.28.1 #18) id m0pVGhW-0000CxC; Sat, 12 Feb 94 01:31 PST
Received: from black.csi.cam.ac.uk by ppsw2.cam.ac.uk
with SMTP-CAM (PP-6.0) as ppsw.cam.ac.uk
id <07012-0@ppsw2.cam.ac.uk>; Sat, 12 Feb 1994 09:31:41 +0000
Received: from hermes.cam.ac.uk by black.csi.cam.ac.uk
id <22704-0@black.csi.cam.ac.uk>; Sat, 12 Feb 1994 09:31:39 +0000
Date: Sat, 12 Feb 1994 09:32:44 +0000 (GMT)
In-Reply-To: <m0pUcJV-0000AFC@crash.cts.com>
Message-ID: <Pine.3.89.9402120957.A12049-0100000@blue.csi.cam.ac.uk>
MIME-Version: 1.0
Content-Type: TEXT/PLAIN; charset=US-ASCII
Sender: dmh1002@hermes.cam.ac.uk
From: Dave Higginson <dmh1002@hermes.cam.ac.uk>
To: The AmigaE Mailing List <AmigaE@bkhouse.cts.com>
Subject: Re: Thanx
On Thu, 10 Feb 1994, Olivier Anh wrote:
> Why is l.head:=l+4, for what is this 4 ?
> What is the meaning of .tailpred. I know the others items, but this not one.
4 is the size of a pointer. So l+4 is actually a pointer to the Tail
field of the List.
Memory List Head Node Tail Node
-----------------------------------------
l Head Head.Succ -
l+4 Tail Head.Pred Tail.Succ <- always NIL
l+8 TailPred - Tail.Pred
This is how you should think of a list. Even though there are only 3
pointers, there are actually 4, but because 2 of them are always NIL
(Head.Pred and Tail.Succ), you can put them in the same memory to save
space. So l is a pointer to the Head Node and l+4 is a pointer to the
tail node. The Head node's successor is the tail node when the list is
empty, hence List.Head:=l+4
> /*-- This is where the string gadget buffer is hidden. --*/
> stringInfo:=stringGadget.specialinfo
> stringGadgetValue:=stringInfo.buffer
> /*-------------------------------------------------------*/
>
> What do you measn with 'hidden' ?
It's not really hidden, just that C= buried it rather deep in the gadget
structure :-)
> Must we always detach the list from the listview gadget before modifying it ?
Yes. Otherwise Intuition might try to refresh the gadget using the list
while you were messing about with its pointers. That's the disadvantage
of a pre-emptive multitasking system :-)
Hope this helps,
Dave
P.S. If you have the RKM Libraries there is a whole chapter on Lists
which probably explains them better than I can.
+--
// David Higginson, dmh1002@hermes.cam.ac.uk
\X/ Churchill College, Cambridge, CB3 0DS, UK